home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: MegaDisc / MegaDisc 42 (1994-11)(MegaDisc Digital Publishing)(AU)(Disk 1 of 2)[WB].zip / MegaDisc 42 (1994-11)(MegaDisc Digital Publishing)(AU)(Disk 1 of 2)[WB].adf / Programming / C_Tutes_9&10 / Program5.c < prev    next >
C/C++ Source or Header  |  1994-12-12  |  454b  |  21 lines

  1.  
  2. /*************************************************************
  3.   Example using a pointer variable.
  4. **************************************************************/
  5.  
  6. main()
  7. {
  8. int *my_pointer,dogs;
  9.  
  10. my_pointer=&dogs;  /* my_pointer holds the address of the variable dogs */
  11.  
  12. dogs=100; /* The integer variable dogs now equals 100 */
  13.  
  14. printf("\ndogs=%d\n",dogs);
  15.  
  16. *my_pointer=50; /* The integer variable dogs now equals 50 */
  17.  
  18. printf("dogs=%d\n\n",dogs);
  19.  
  20. }
  21.